<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    561. Array Partition I
   </h1>
   <p>
    Given an array of
    <b>
     2n
    </b>
    integers, your task is to group these integers into
    <b>
     n
    </b>
    pairs of integer, say (a
    <sub>
     1
    </sub>
    , b
    <sub>
     1
    </sub>
    ), (a
    <sub>
     2
    </sub>
    , b
    <sub>
     2
    </sub>
    ), ..., (a
    <sub>
     n
    </sub>
    , b
    <sub>
     n
    </sub>
    ) which makes sum of min(a
    <sub>
     i
    </sub>
    , b
    <sub>
     i
    </sub>
    ) for all i from 1 to n as large as possible.
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> [1,4,3,2]

<b>Output:</b> 4
<b>Explanation:</b> n is 2, and the maximum sum of pairs is 4 = min(1, 2) + min(3, 4).
</pre>
   <p>
    <b>
     Note:
    </b>
    <br>
   </p>
   <ol>
    <li>
     <b>
      n
     </b>
     is a positive integer, which is in the range of [1, 10000].
    </li>
    <li>
     All the integers in the array will be in the range of [-10000, 10000].
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    561. 数组拆分 I
   </h1>
   <p>
    给定长度为&nbsp;
    <strong>
     2n&nbsp;
    </strong>
    的数组, 你的任务是将这些数分成&nbsp;
    <strong>
     n
    </strong>
    对, 例如 (a
    <sub>
     1
    </sub>
    , b
    <sub>
     1
    </sub>
    ), (a
    <sub>
     2
    </sub>
    , b
    <sub>
     2
    </sub>
    ), ..., (a
    <sub>
     n
    </sub>
    , b
    <sub>
     n
    </sub>
    ) ，使得从1 到&nbsp;n 的 min(a
    <sub>
     i
    </sub>
    , b
    <sub>
     i
    </sub>
    ) 总和最大。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> [1,4,3,2]

<strong>输出:</strong> 4
<strong>解释:</strong> n 等于 2, 最大总和为 4 = min(1, 2) + min(3, 4).
</pre>
   <p>
    <strong>
     提示:
    </strong>
   </p>
   <ol>
    <li>
     <strong>
      n
     </strong>
     &nbsp;是正整数,范围在 [1, 10000].
    </li>
    <li>
     数组中的元素范围在 [-10000, 10000].
    </li>
   </ol>
  </div>
 </body>
</html>